home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17729 < prev    next >
Encoding:
Text File  |  1996-08-05  |  4.8 KB  |  160 lines

  1. Path: ix.netcom.com!news
  2. From: lewkbj@ix.netcom.com (leonel wizel )
  3. Newsgroups: comp.lang.c++
  4. Subject: I need help with homework
  5. Date: 17 Apr 1996 03:13:15 GMT
  6. Organization: Netcom
  7. Message-ID: <4l1nkb$ci5@dfw-ixnews3.ix.netcom.com>
  8. NNTP-Posting-Host: ix-nyc9-12.ix.netcom.com
  9. X-NETCOM-Date: Tue Apr 16 10:13:15 PM CDT 1996
  10.  
  11.   Please I need help to complete this file:   this file suppose to
  12. increment the object time by one second to the next hour, to the
  13. next minute to the next day:
  14.  
  15. I need some help please:
  16.  
  17.  
  18. the program suppose to modify to include a tick member function
  19. that increments the time stored in the Time object by one second.  The
  20. time object should always remain in a consistent state.  The driver
  21. program that tests the tick member function in a loop that prints the
  22. time in standard format during each iteration of the loop to illustrate
  23. that the ti
  24.  
  25. ck member functions workds correctly.  
  26.  
  27.     Incrementing into the next minute.
  28.     Incrementing into the next hour.
  29.     incrementing into the next day(i.e., 11:59:59 PM to 12:00:00 AM).
  30.  
  31.  
  32.     Create a modified class Time combined it with another class
  33. called "DateAndtime".  Modify the tick function  to call the nextDay
  34. function if the time is incremented into the next day.  Modify function
  35. printStandard and PrintMilitary to output thee date in addtion to the
  36. time.  Wri
  37. te a driver program to test the new class "DateAndTime".  specifically
  38. test incrementing the time into the next day.
  39.  
  40.     Modify the Date class to perform error checking on the initializer
  41. values for data members month, day and year.  Also provide a member
  42. function NextDay to increment the day by one.  The Date object should
  43. always remai
  44. n in a consistent state.  Write a driver program that tests the nextDay
  45. function in a loop that prints the date during each iteration of the
  46. loop to illustrate that the Nextday function works correctly.  I have
  47. to make su
  48. re to test the following cases:
  49.  
  50.     Incrementing into the next month.
  51.     incrementing into the next year.
  52.  
  53.  
  54. Modify the set functions in the previous program to return appropiate
  55. error values if an attempt is made to set a data member of an object of
  56. class Time to an invalid values.
  57.  
  58. thank you for your cooFrom: lewkbj@ix.netcom.com (leonel wizel )
  59. Newsgroups: comp.lang.c++
  60. Subject: I need help with homework
  61.  
  62.   Please I need help to complete this file:   this file suppose to
  63. increment the object time by one second to the next hour, to the
  64. next minute to the next day:
  65.  
  66. I need some help please:
  67.  
  68.  
  69. the program suppose to modify to include a tick member function
  70. that increments the time stored in the Time object by one second.  The
  71. time object should always remain in a consistent state.  The driver
  72. program that tests the tick member function in a loop that prints the
  73. time in standard format during each iteration of the loop to illustrate
  74. that the ti
  75.  
  76. ck member functions workds correctly.  
  77.  
  78.     Incrementing into the next minute.
  79.     Incrementing into the next hour.
  80.     incrementing into the next day(i.e., 11:59:59 PM to 12:00:00 AM).
  81.  
  82.  
  83.     Create a modified class Time combined it with another class
  84. called "DateAndtime".  Modify the tick function  to call the nextDay
  85. function if the time is incremented into the next day.  Modify function
  86. printStandard and PrintMilitary to output thee date in addtion to the
  87. time.  Wri
  88. te a driver program to test the new class "DateAndTime".  specifically
  89. test incrementing the time into the next day.
  90.  
  91.     Modify the Date class to perform error checking on the initializer
  92. values for data members month, day and year.  Also provide a member
  93. function NextDay to increment the day by one.  The Date object should
  94. always remai
  95. n in a consistent state.  Write a driver program that tests the nextDay
  96. function in a loop that prints the date during each iteration of the
  97. loop to illustrate that the Nextday function works correctly.  I have
  98. to make su
  99. re to test the following cases:
  100.  
  101.     Incrementing into the next month.
  102.     incrementing into the next year.
  103.  
  104.  
  105. Modify the set functions in the previous program to return appropiate
  106. error values if an attempt is made to set a data member of an object of
  107. class Time to an invalid values.
  108.  
  109. thank you for your coo#include <iostream.h>
  110. #include "time3.h"
  111. #include "time3.cpp"
  112.  
  113.  
  114. main()
  115. {
  116.   Time t;
  117.  
  118.   t.setTime(23, 59, 59);
  119.  
  120.   for(long int i = 1; i <= 2; i++)
  121.     {
  122.         cout << endl << endl;
  123.         cout << " Hour " << t.getHour()
  124.               << " Minute " << t.getMinute()
  125.               << " Second " << t.getSecond();
  126.  
  127.         cout <<"the initial time before incrementing is: " << endl
  128. << endl;
  129.  
  130.         t.printStandard();
  131.         cout << endl;
  132.         t.printMilitary();
  133.  
  134.         t.tick_increment();
  135.         cout << " Hour " << t.getHour()
  136.               << " Minute " << t.getMinute()
  137.               << " Second " << t.getSecond()
  138.               <<" the time after incrementing is: " << endl;
  139.  
  140.         t.printStandard();
  141.         cout << endl;
  142.         t.printMilitary();
  143.  
  144.     }
  145.  
  146.  
  147.  
  148.     return 0;
  149. }
  150.  
  151.     thank you all of you for your cooperation and help.
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.